﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using HSE.Events;
using DIST.LR.ZHJG.Events;
using PetroMentor.Service;
using HSE.Common;

namespace HSE
{
    public partial class Login : UserControl
    {
        Storyboard showlogin;
        Storyboard hiddenlogin;
        public LoginViewModel viewmodel;
        public Login()
        {
            InitializeComponent();
            showlogin = this.Resources["sbshowlogin"] as Storyboard;
            hiddenlogin = this.Resources["sbhiddenlogin"] as Storyboard;
            viewmodel = new LoginViewModel();
            this.DataContext = viewmodel;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            hiddenlogin.Begin();
        }

        private void btn_login_Click(object sender, RoutedEventArgs e)
        {
            viewmodel.Login();
        }

        private void sys01_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            showlogin.Begin();
            viewmodel.SelectSys = viewmodel.Sys1;
            viewmodel.SelectSysname = viewmodel.Sys1name;
            SystemVar.CurrentSysID = "02";
            SystemVar.CurrentSysNAME = "基层HSE运维管理系统";

        }

        private void sys02_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            showlogin.Begin();
            viewmodel.SelectSys = viewmodel.Sys2;
            viewmodel.SelectSysname = viewmodel.Sys2name;
            SystemVar.CurrentSysID = "01";
            SystemVar.CurrentSysNAME = "基层HSE动态监控信息展示系统";

        }
    }
}
